GXCloneShape
You can use theGXCloneShape
function to clone a shape--that is, to add a reference to it and increment its owner count.
gxShape GXCloneShape(gxShape source);
source
- A reference to the shape to clone.
- function result
- A reference to the cloned shape.
DESCRIPTION
TheGXCloneShape
function returns a reference to the shape object specified by thesource
parameter and increments its owner count by 1. You typically use this function when you want to create another reference to an existing shape rather than create a distinct copy of the shape.This function returns as its function result a reference to the shape--the same reference you pass in as the
source
parameter. Thus you can clone a shape with the following line of C code:
aShapeClone = GXCloneShape(aShape);This line of code has almost the same affect as
aShapeClone = aShape;that is, it sets theaShapeClone
variable to reference the same shape object as theaShape
variable. The difference is thatGXCloneShape
also increments the shape's owner count.ERRORS, WARNINGS, AND NOTICES
Errors shape_is_nil SEE ALSO
Owner counts are discussed in the section "Copying, Comparing, and Cloning Shape Objects" beginning on page 2-25, and in the section "Manipulating a Shape Object's Owner Count" beginning on page 2-31.To examine the owner count of a shape, use the
GXGetShapeOwners
function, described on page 2-76. To decrement the owner count of a shape, use theGXDisposeShape
function, described on page 2-55.